using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

using AIFSDataAccessLayer;
using AIFSCMSDataAccessLayer.Dao;

namespace AIFSCMSDataAccessLayer.DaoImpl
{
    public class FragmentDao : IFragmentDao
    {
        IDataExecutionContext dataExecutionContext;

        public FragmentDao(IDataExecutionContext dataExecutionContext)
        {
            this.dataExecutionContext = dataExecutionContext;
        }

        public DataTable GetFragment(int? fragmentId)
        {
            IDataExecutionContext dataContext = this.DataExecutionContext;
            DalSqlCommand cmd = dataContext.CreateStoredProcCommand("GetFragment");

            cmd.CreateParameter("FRAGMENT_ID", fragmentId);

            DataTable dt = dataContext.ExectuteDataTable(cmd);

            return dt;
        }

        #region IDataAccessObject Members

        public IDataExecutionContext DataExecutionContext
        {
            get { return this.dataExecutionContext; }
        }

        #endregion
    }
}
